#include<iostream>
#include<algorithm>
using namespace std;
const int N = 11;
int arr[N];
int n, m;
int main()
{
	for (int i = 1; i <= 10; i++) {
		cin >> arr[i];
	}
	cin >> m;
	int ans = 0;
	for (int i = 1; i <= 10; i++) {
		if (30 + m >= arr[i])ans++;
	}
	cout<<ans<<endl;
	return 0;
}